﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Blockey.GameObjects3D
{
    public abstract class DrawableObject
    {

        public abstract void Draw(GraphicsDevice oGraphics, Camera3D oCamera);

        public void SetTransformation(Vector3? vTranslation, Vector3? vRotation, float? vScale)
        {
            if (vScale != null)
                m_fScale = (float)vScale;

            if (vRotation != null)
                m_vRotation = (Vector3)vRotation;

            if (vTranslation != null)
                m_vTranslation = (Vector3)vTranslation;

            //ApplyWorldEffect();

            SetSphere();
        }

        public abstract void SetTexture(Texture2D oTexture);

        //protected abstract void ApplyWorldEffect();

        protected abstract void SetSphere();

        public BoundingSphere Sphere
        {
            get { return m_oSphere; }
            set { m_oSphere = value; }
        }

        public Vector3 Rotation
        {
            get { return m_vRotation; }
        }

        public Matrix World
        {
            get { return m_mWorld; }
        }

        public Material Material
        {
            get { return m_oMaterial; }
            set { m_oMaterial = value; }
        }

        protected Matrix m_mWorld;

        protected BoundingSphere m_oSphere;

        protected Effect Effect
        {
            get { return m_oEffect; }
            set { m_oEffect = value; }
        }

        protected Vector3 m_vTranslation;
        protected Vector3 m_vRotation;
        protected float m_fScale;
        private Material m_oMaterial;
        protected Effect m_oEffect;

    }
}
